﻿using Newtonsoft.Json;

namespace Missbot.Model.MsgCmds.Notes
{
    /// <summary>
    /// 发表嘟文命令
    /// </summary>
    public class CreateNoteCmd : IMsgCommand
    {
        protected override string API => "notes/create";

        /// <summary>
        /// 嘟文内容
        /// </summary>
        [JsonProperty("text")]
        public string Text { get; set; }

        /// <summary>
        /// 嘟文公开范围
        /// </summary>
        /// <remarks>public/home/followers/specified</remarks>
        [JsonProperty("visibility")]
        public virtual string Visibility { get; set; } = "public";

        /// <summary>
        /// 是否是通过手机发送的嘟文
        /// </summary>
        [JsonProperty("viaMobile")]
        public bool ViaMobile { get; set; }
        
        /// <summary>
        /// 是否仅在本地显示嘟文
        /// </summary>
        [JsonProperty("localOnly")]
        public bool LocalOnly { get; set; }

        /// <summary>
        /// 回复嘟文ID
        /// </summary>
        [JsonProperty("replyId")]
        public string ReplyId { get; set; }
        
        /// <summary>
        /// 转发嘟文ID
        /// </summary>
        [JsonProperty("renoteId")]
        public string RenoteId { get; set; }
    }

    /// <summary>
    /// 发起投票模型
    /// </summary>
    public class NotePollModel
    {
        /// <summary>
        /// 投票选项
        /// </summary>
        [JsonProperty("choices")]
        public string[] Choices { get; set; }
        
        /// <summary>
        /// 是否可以多选
        /// </summary>
        [JsonProperty("multiple")]
        public bool Multiple { get; set; }
        
        [JsonProperty("expiresAt")]
        public long ExpiresAt { get; set; }
        
        [JsonProperty("expiredAfter")]
        public long ExpiredAfter { get; set; }
    }
    
    public class CreateNoteSpecifiedCmd : CreateNoteCmd
    {
        public override string Visibility { get; set; } = "specified";
        
        [JsonProperty("visibleUserIds")]
        public string[] VisibleUserIds { get; set; }
    }
    
    public class CreateNoteSpecifiedWithFileCmd : CreateNoteSpecifiedCmd
    {
        [JsonProperty("fileIds")]
        public string[] FileIDs { get; set; }
    }
    
    public class CreateNoteWithFileCmd : CreateNoteCmd
    {
        [JsonProperty("fileIds")]
        public string[] FileIDs { get; set; }
    }
}